package com.pausa.sgdi.ejb.bean;

import javax.ejb.Local;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

//import com.pausa.sgdi.ejb.entities.Welcome;

@Stateless
@Local(HelloWorldService.class)
public class HelloWorldServiceBean implements HelloWorldService {

    @PersistenceContext
    protected EntityManager manager;

    @Override
    public String sayHello(String name) {
//    	Welcome welcome = new Welcome();
//    	welcome.setName(name);
//        manager.persist(welcome);
        return "Hello " + name + "!";
    }

//    @SuppressWarnings("unchecked")
//    @Override
//    public List<Welcome> findWelcomeHistory() {
//        Query query = manager.createQuery("from " + Welcome.class.getName());
//        return query.getResultList();
//    }
}